﻿using System;
using SolutionSorter.Core;
using System.Reflection;

namespace SolutionSorter.Console
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            var container = new Container();
            new Bootstrapper().Initialize(container);
            container.Resolve<IConfiguration>().ProgramArgs = args;
            container.Resolve<SortManager>().SortSolutionFile();
        }

        static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            return EmbeddedAssemblyLoader.LoadAssemby(args.Name); 
        }   

    }
}
